﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"  %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
        <link href="../Styles/css.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/ts_css.css" rel="stylesheet" type="text/css" />
</head>

<script src="../Scripts/jquery.js" type="text/javascript"></script>
<body>
<form action="addhtroom.do" method="post">
<div id="main">
        <div class="tsdj">
            <div class="tsdj_1">
                <div class="tsdj_1_font">
                    添加房间</div>
            </div>
<table class="table_list1" border="0" cellspacing="2" cellpadding="2">
                    <tbody>
                        <tr>
                           
                            <td class="table_list1_style1" width="16%">
                                <div id="spanbusinessNameDiv">
                                    <div id="businessNamePanel">
                                        <span id="spanBusinessName">项目名称</span>
                                    </div>
                                </div>
                            </td>
                            <td class="table_list1_style2" width="22%">
                                <div id="projectNameDiv">
                                    <div id="projectNameDivs">
                                    	<select type="text" style="width: 96%" name="projectId" id="projectId" value="" >
					                    <option value="">-------请选择项目名称-------</option>
					                     <c:forEach var="bean" items="${list}">
					                      <option value="${bean.projectName}">${bean.projectName}</option>
					                     </c:forEach>
					                    </select>
					                    

                                        
                                    </div>
                                    
                                </div>
                                
                            </td>
                           <td class="table_list1_style1" width="16%">
                                <div id="spanbusinessNameDivaa">
                                    <div id="businessNamePanelaa">
                                        <span id="spanBusinessName">楼栋名称</span>
                                    </div>
                                </div>
                            </td>
                            <td>
                            <select type="text" style="width: 96%" name="buildId" id="buildId" value="">
					                    <option value="">-------请选择楼栋-------</option>
					       </select>
                  
                            </td>
                        </tr>
                        <tr>
                            <td class="table_list1_style1" width="16%">
                                <span style="font-style: normal; font-family: Arial; color: #ff0000; font-size: 13px;
                                    font-weight: normal; text-decoration: none">*</span><span id="complainantName">单元</span>
                            </td>
                            <td class="table_list1_style2" width="12%">
                                 <select type="text" style="width: 96%" name="unitId" id="unitId" value="">
					                    <option value="">-------请选择单元-------</option>
					       </select></td>
                            <td class="table_list1_style1" width="16%">
                                <span style="font-style: normal; font-family: Arial; color: #ff0000; font-size: 13px;
                                    font-weight: normal; text-decoration: none">*</span><span id="respectivePro">户型</span>
                            </td>
                            <td class="table_list1_style2" width="16%">
                             <select type="text" style="width: 96%" name="apartmentLayoutId" id="apartmentLayoutId" value="">
					                    <option value="">请选择户型</option>
					                    <option value="仓库">仓库</option>
					                    <option value="阳台">阳台</option>
					                    <option value="地下室">地下室</option>
					                    
					       </select>
                                </td>
                            <td class="table_list1_style1" width="16%">
                                <span style="font-style: normal; font-family: Arial; color: #ff0000; font-size: 13px;
                                    font-weight: normal; text-decoration: none">*</span> <span id="complaintNumber">用途</span>
                            </td>
                            <td class="table_list1_style2" width="12%"><select type="text" style="width: 96%" name="purposeId" id="purposeId" value="">
					                    <option value="">-------请选择用途-------</option>
					                    <option value="1">1</option>
					                    <option value="2">2</option>
					                    <option value="3">3</option>
					                    <option value="4">4</option>
					                    <option value="5">5</option>
					                    <option value="6">6</option>
					       </select>
                          </td>
                        </tr>
                        <tr>
                            <td class="table_list1_style1" width="16%">
                                <span id="preferred">楼层</span>
                            </td>
                            <td class="table_list1_style2" width="16%">
                                <input style="width: 96%" id="floor" maxlength="16" type="text" name="floor" value="">
                            </input></td>
                            <td class="table_list1_style1" width="16%">
                                <span id="other">房间房号</span>
                            </td>
                            <td class="table_list1_style2" width="16%">
                                <input style="width: 96%" id="roomCode" maxlength="16" type="text" name="roomCode" value="">
                            </input></td>
                             <td class="table_list1_style1" width="16%">
                                <span id="other">建筑面积</span>
                            </td>
                            <td class="table_list1_style2" width="16%">
                                <input style="width: 96%" id="buildUpArea" maxlength="16" type="text" name="buildUpArea" value="">
                            </input></td>

                        </tr>
                         <tr>
                           
                        <tr>
                            <td class="table_list1_style1" width="16%">
                                <span id="preferred">套内面积</span>
                            </td>
                            <td class="table_list1_style2" width="16%">
                                <input style="width: 96%" id="innerArea" maxlength="16" type="text" name="innerArea" value="">
                            </input></td>
                            <td class="table_list1_style1" width="16%">
                                <span id="other">套内面积单价</span>
                            </td>
                            <td class="table_list1_style2" width="16%">
                                <input style="width: 96%" id="innerPrice" maxlength="16" type="text" name="innerPrice" value="">
                            </input></td>
                             <td class="table_list1_style1" width="16%">
                                <span id="other">建筑面积单价</span>
                            </td>
                            <td class="table_list1_style2" width="16%">
                                <input style="width: 96%" id="unitPrice" maxlength="16" type="text" name="unitPrice" value="">
                            </input></td>

                        </tr>
                        <tr>
                            <td class="table_list1_style1" width="16%">
                                <span id="preferred">标准总价</span>
                            </td>
                            <td class="table_list1_style2" width="16%">
                                <input style="width: 96%" id="deleteState" maxlength="16" type="text" name="deleteState" value="">
                            </input></td>
                            <td class="table_list1_style1" width="16%">
                                <span id="other">状态</span>
                            </td>
                            <td class="table_list1_style2" width="16%">
                               <select type="text" style="width: 96%" name="state" id="state" value="">
					                    <option value="">-------请选择状态-------</option>
					                    <option value="0">未建成</option>
					                    <option value="1">已建成</option>
					                    <option value="2">已开售</option>
					                    <option value="3">已售完</option>
					       </select></td>

                        </tr>
                        <tr>
                         <td class="table_list1_style2" width="16%">
                                <input id="btnIsDraftFirst" class="button" value="提交" type="submit">
                            </td>
                             <td class="table_list1_style2" width="16%">
                                <input id="btnIsDraftSecond" class="button" value="重置" type="reset">
                            </td>                      
                        </tr>   
                       
                    </tbody>
                </table></form>
    <div id="main">
        <div class="tsdj">
            <div class="tsdj_1">
                <div class="tsdj_1_font">
                   </div>
            </div>
            <div>
                
            </div>
        </div>
        </form>
        
        <input id="hidFileplaintId" type="hidden" name="hidFileplaintId">
        <!-- ID之间用‘,’分隔 -->
        <input id="hidProductId" value="103872" type="hidden" name="hidProductId">
        <input id="hidProductName" type="hidden" name="hidProductName">
        <input id="hidComplaintId" value="14863F9D3E2B46678D3FB89B082B6511" type="hidden"
            name="hidComplaintId">
        <input id="hidCenter" value="false" type="hidden" name="hidCenter">
        <input id="hidIsAdmin" value="True" type="hidden" name="hidIsAdmin">
        <input id="hidLogo" value="1" type="hidden" name="hidLogo">
        <input id="hidComplaintState" value="7" type="hidden" name="hidComplaintState">
        <div class="blank8">
        </div>
        <div>

       </div>
<script type="text/javascript">
$(function(){
$("#projectId").change(function(){
projectId=$("#projectId").val();
 $.ajax({			
			    url:"../htbuild/addRoomajax.do",
				type:"post",
				dataType:"text",
				data:{"projectId":projectId},
				success:function(data){
				
					 var buildId = $("#buildId");
					
				      
				      
				      var arr=data.split(',');
				   	  for (var i = 0; i <arr.length; i++) {
				   	  	  var build= arr[i];
						  var $option = $("<option value="+build+">"+build+"</option>");
						  buildId.append($option);
					}
			  }
		 });
});
});
$(function(){
$("#buildId").change(function(){
projectId=$("#projectId").val();
buildName=$("#buildId").val();
 $.ajax({			
			    url:"../htbuild/addRoomajaxs.do",
				type:"post",
				dataType:"text",
				data:{"projectId":projectId,"buildName":buildName},
				success:function(data){				
					 var unitId = $("#unitId");
				   	  for (var i = 1; i <=data; i++) {
						  var $option = $("<option value="+i+"单元"+">"+i+"单元"+"</option>");
						  unitId.append($option);
					}
			  }
		 });
});
});
</script>         
</body>
</html>
